package okw.database;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;

public class Election extends core.modules.database.SuperElection implements
		Serializable {

	private static final long serialVersionUID = 4676434490497586052L;

	private Set<VotingCard> votingCards = new HashSet<VotingCard>();
	private Set<AdministratorToken> administratorTokens = new HashSet<AdministratorToken>();
	private Set<Voter> voters = new HashSet<Voter>();
	private SummaryPackage summaryPackage = null;
	private Timestamp actualStartDate = null;
	private Timestamp actualEndDate = null;

	public Election() {
		super();
	}

	public Election(String name, Timestamp startDate, Timestamp endDate) {
		super(name, startDate, endDate);
	}

	public Set<Voter> getVoters() {
		return voters;
	}

	public void setVoters(Set<Voter> voters) {
		this.voters = voters;
	}

	public Set<VotingCard> getVotingCards() {
		return votingCards;
	}

	public void setVotingCards(Set<VotingCard> votingCards) {
		this.votingCards = votingCards;
	}

	public Set<AdministratorToken> getAdministratorTokens() {
		return administratorTokens;
	}

	public void setAdministratorTokens(
			Set<AdministratorToken> administratorTokens) {
		this.administratorTokens = administratorTokens;
	}
	
	public void addToAdministratorToken(AdministratorToken administratorToken){
		this.getAdministratorTokens().add(administratorToken);
		administratorToken.setElection(this);
	}

	public SummaryPackage getSummaryPackage() {
		return summaryPackage;
	}

	public void setSummaryPackage(SummaryPackage summaryPackage) {
		this.summaryPackage = summaryPackage;
	}

	public Timestamp getActualStartDate() {
		return actualStartDate;
	}

	public void setActualStartDate(Timestamp actualStartDate) {
		this.actualStartDate = actualStartDate;
	}

	public Timestamp getActualEndDate() {
		return actualEndDate;
	}

	public void setActualEndDate(Timestamp actualEndDate) {
		this.actualEndDate = actualEndDate;
	}
}
